extracting digits from a number in c